<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'IndexController@index');

    // --------------------------------------
    // scaffold
    // 脚手架
    // --------------------------------------
    $router->get('scaffold/controller', 'Scaffold\ControllerGeneratorController@index');         // 生成控制器代码的准备页面
    $router->post('scaffold/controller', 'Scaffold\ControllerGeneratorController@generate');     // 生成控制器代码
    $router->get('scaffold/controller/schema', 'Scaffold\ControllerGeneratorController@schema'); // 获得数据库结构

    $router->get('scaffold/statictab', 'Scaffold\StaticTabTableGeneratorController@index');      // 生成多个Tab的控制器代码的准备页面
    $router->post('scaffold/statictab', 'Scaffold\StaticTabTableGeneratorController@generate');  // 生成
    $router->get('scaffold/test', 'Scaffold\StaticTabTableGeneratorController@test');            // 测试

    /**
     *   用户管理
     */
    $router->resource('users', 'UserInfo\ICMEUserInfoController');
    $router->post('users/{enabled}', 'UserInfo\ICMEUserInfoController@enabled');

});
